<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        /* 内部样式表 */
        #one{
            width: 500px;
            height: 500px;
            background-color: blue;
        }
    </style>
</head>
<body>
    <div id="one"></div>
</body>
<script>

    // 注意 1、element.style.height...只能获得行内样式
    var one = document.getElementById('one')
    // console.log(one.style.height); 
    // console.log(one.style.backgroundColor); 
    // console.log(one.style.backgroundColor); 
    // // 2、如何获得样式表里面的样式
    // Chrome 和 Firefox和IE9以上是用的是getComputedStyle(obj)[type],IE678用的是element.currentStyle[attr];
    console.log(getComputedStyle(one).backgroundColor);
    // console.log(one.currentStyle['height']);
</script>
</html>